package net.wangds.dymodel.query;

import net.wangds.dymodel.meta.entity.DyModelDefEntity;
import net.wangds.dymodel.utls.DynamicModelUtils;
import net.wangds.jdbc.comp.jdbc.JdbcComp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * .
 * <p></p>
 *
 * @author 王东石 2021/2/17 16:47.
 */
@Component
public class DeleteParse {

    @Autowired
    private JdbcComp mmJdbc;

    public void delete(String id, DyModelDefEntity def){
        String sql = "DELETE FROM "+ DynamicModelUtils.toFullTableName(def)+" WHERE `id`=?";
        mmJdbc.executeUpdate(sql, new Object[]{id});
    }

}
